<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="copyright" content="闻康集团刘代明监制" />
<?php echo $css_file;?>
</head>
<body>
<div class="main">
	<div class="crumbs">
	当前位置：<span id="current_pos">设置->角色管理</span>
	</div>
    <div class="m_content" id="right_main">
        <div class="content_menu blue line-x">
            <a class="on" href="__GROUP__/Setting/roleadd"><em>添加角色</em></a>
        </div>
        <div>
			<form  method="post" action="" name="myForm">
                <div class="table_list">
                <table width="100%" cellspacing="0">
                	<thead>
                		<tr>
                			
                			<th align="left"></th>
                			<th align="left">排序</th>
                			<th align="left">ID</th>
                			<th align="left">角色名称</th>
                			<th align="left">是否显示</th>
                			<th align="left">添加时间</th>
                			<th align="left">添加IP</th>
                			<th align="left">操作</th>
                		</tr>
                	</thead>
                    <tbody>
                    	<?php 
                    	    if(empty($list)){
                    	        echo '<tr><td colspan="11" style="text-align:center;">没有找到任何数据</td></tr>';
                    	    }else {
                    	foreach ($list as $val){
                    	?>
                        <tr>
                    		
                    		<td align="left"></td>
                    		<td align="left"><?php echo $val['sort'];?></td>
                    		<td align="left"><?php echo $val['role_id'];?></td>
                    		<td align="left"><?php echo $val['name'];?></td>
                    		<td align="left"><?php if ($val['status']=='1'){echo '是';}else{echo '否';}?></td>
                    		<td align="left"><?php echo date("Y-m-d H:i:s",$val['add_time']);?></td>
                    		<td align="left"><?php echo long2ip($val['add_ip']);?></td>
                    		<td align="left">
                    			<?php 
                    			if($val['role_id']==1){
                    			?>
                    				<span style="color:#ccc">[权限设置]</span> 
                    				<!-- 
                    				<span style="color:#ccc">[修改]</span> 
                    				<span style="color:#ccc">[删除]</span>
                    				 -->
                    			<?php 
                    			}else{
                    			?>
                    			<a href="javascript:void(0)" onclick="dialog_role(this,'__GROUP__/Setting/setpriv/roleid/<?php echo $val['role_id'];?>')">[权限设置]</a>
                    			<!-- 
                    			<a href="__GROUP__/Setting/roleedit/roleid/<?php echo $val['role_id'];?>">[修改]</a>
                    			<a href="javascript:void(0)" onclick="dialog_delete(this,'__GROUP__/Setting/roledel/roleid/<?php echo $val['role_id'];?>')">[删除]</a>
                    			 -->
                    			<?php }?>
                    		</td>
                        </tr>
                        <?php
                    	    } 
                    	}
                        ?>
					</tbody>
                </table>
    		</div>
    		</form>
		</div>
    </div>
</div>
<?php echo $js_file,$dialog;?>
<script type="text/javascript">
function selectAll(obj, name){
	if (name == null) {
		name = 'checkboxes';
	}
	var elems = obj.form.getElementsByTagName("input");
	for ( var i = 0; i < elems.length; i++) {
		if (elems[i].name == name || elems[i].name == name + "[]") {
			elems[i].checked = obj.checked;
		}
	}
}
/**
 * 删除提示
 */
function dialog_delete(obj,url){
	$.dialog({
		title:'删除',
		fixed:true,
	    resize: false,
	    ok:true,
	    cancelVal: '取消',
	    cancel: true,
    	content:'确定要删除吗,删除后不可恢复?',
    	ok:function(){
        	window.location.href=url;
        }
		
	});
}
/**
 * 权限设置
 */
function dialog_role(obj,url){
	$.get(url,function(data){
		$.dialog({
			title:'权限设置',
			fixed:true,
		    resize: false,
	    	content:data,
		});
	});
	
}
</script>
</body>

</html>
			
